package com.xiaohao.student_course.dao;

import com.xiaohao.student_course.bean.Major;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 小浩
 * @date 2018-12-16 17:30
 * @package com.xiaohao.student_course.dao
 * @description
 */
public interface MajorDao extends JpaRepository<Major,Integer> {
    /**
     * 返回名字
     * @return
     */
    @Query("select majorname from  Major")
    List<String> findAllMajorName();
}
